package com.warmheart.base.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;

/**
 * 
 * @ClassName: SysConfig
 * @Description: 系统配置
 * @author ZhangJianyang
 * @date 2025-06-16 09:37:02
 *
 */
@Configuration
@PropertySource(factory = YamlPropertySourceFactory.class, value = "classpath:sys-config.yml")
@ConfigurationProperties(prefix = "sys")
public class SysConfig {

    private Integer duplicateOnclickTime = 2;

    private Integer sessionExpire = 1296000;

    private Integer secretMangerExpire = 2592000;

    private Log log = new Log();

    private Encrypt encrypt = new Encrypt();

    private Sign sign = new Sign();

    /**
     * 
     * @ClassName: Log
     * @Description: 日志
     * @author ZhangJianyang
     * @date 2025-06-16 09:37:02
     *
     */
    public class Log {

        /**
         * 参数
         */
        private Boolean param = false;

        /**
         * 响应
         */
        private Boolean result = false;

        public Boolean getParam() {
            return param;
        }

        public void setParam(Boolean param) {
            this.param = param;
        }

        public Boolean getResult() {
            return result;
        }

        public void setResult(Boolean result) {
            this.result = result;
        }
    }

    /**
     * 
     * @ClassName: Log
     * @Description: 加密
     * @author ZhangJianyang
     * @date 2025-06-16 09:37:02
     *
     */
    public class Encrypt {

        private Param param = new Param();

        private Result result = new Result();

        /**
         * 
         * @ClassName: Param
         * @Description: 参数
         * @author ZhangJianyang
         * @date 2025-06-16 09:37:02
         *
         */
        public class Param {
            /**
             * 是否解密
             */
            private Boolean status = false;

            /**
             * 解密方式(默认为MD5，可选MD5、AES、RSA、MD5+RSA、AES+RSA)
             */
            private String type = "MD5";

            /**
             * 秘钥(解密方式为MD5时必须设置)
             */
            private String secret;

            /**
             * 密码(解密方式为AES时必须设置)
             */
            private String password;

            /**
             * 私钥(解密方式为RSA、MD5+RSA、AES+RSA时必须设置)
             */
            private String priKey;

            public Boolean getStatus() {
                return status;
            }

            public void setStatus(Boolean status) {
                this.status = status;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getSecret() {
                return secret;
            }

            public void setSecret(String secret) {
                this.secret = secret;
            }

            public String getPassword() {
                return password;
            }

            public void setPassword(String password) {
                this.password = password;
            }

            public String getPriKey() {
                return priKey;
            }

            public void setPriKey(String priKey) {
                this.priKey = priKey;
            }

        }

        /**
         * 
         * @ClassName: Result
         * @Description: 响应
         * @author ZhangJianyang
         * @date 2025-06-16 09:37:02
         *
         */
        public class Result {
            /**
             * 是否加密
             */
            private Boolean status = false;

            /**
             * 加密方式(默认为MD5，可选MD5、AES、RSA、MD5+RSA、AES+RSA)
             */
            private String type = "MD5";

            /**
             * 秘钥(加密方式为MD5时必须设置)
             */
            private String secret;

            /**
             * 密码(加密方式为AES时必须设置)
             */
            private String password;

            /**
             * 公钥(加密方式为RSA、MD5+RSA、AES+RSA时必须设置)
             */
            private String pubKey;

            public Boolean getStatus() {
                return status;
            }

            public void setStatus(Boolean status) {
                this.status = status;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getSecret() {
                return secret;
            }

            public void setSecret(String secret) {
                this.secret = secret;
            }

            public String getPassword() {
                return password;
            }

            public void setPassword(String password) {
                this.password = password;
            }

            public String getPubKey() {
                return pubKey;
            }

            public void setPubKey(String pubKey) {
                this.pubKey = pubKey;
            }
        }

        public Param getParam() {
            return param;
        }

        public void setParam(Param param) {
            this.param = param;
        }

        public Result getResult() {
            return result;
        }

        public void setResult(Result result) {
            this.result = result;
        }
    }

    /**
     * 
     * @ClassName: Sign
     * @Description: 签名
     * @author ZhangJianyang
     * @date 2025-06-16 09:37:02
     *
     */
    public class Sign {
        private Param param = new Param();

        private Result result = new Result();

        /**
         * 
         * @ClassName: Param
         * @Description: 参数
         * @author ZhangJianyang
         * @date 2025-06-16 09:37:02
         *
         */
        public class Param {
            /**
             * 是否验签
             */
            private Boolean status = false;

            /**
             * 验签方式(默认为MD5，可选MD5、AES、RSA、MD5+RSA、AES+RSA)
             */
            private String type = "MD5";

            /**
             * 秘钥(验签方式为MD5时必须设置)
             */
            private String secret;

            /**
             * 密码(验签方式为AES时必须设置)
             */
            private String password;

            /**
             * 公钥(验签方式为RSA、MD5+RSA、AES+RSA时必须设置)
             */
            private String pubKey;

            public Boolean getStatus() {
                return status;
            }

            public void setStatus(Boolean status) {
                this.status = status;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getSecret() {
                return secret;
            }

            public void setSecret(String secret) {
                this.secret = secret;
            }

            public String getPassword() {
                return password;
            }

            public void setPassword(String password) {
                this.password = password;
            }

            public String getPubKey() {
                return pubKey;
            }

            public void setPubKey(String pubKey) {
                this.pubKey = pubKey;
            }
        }

        /**
         * 
         * @ClassName: Result
         * @Description: 响应
         * @author ZhangJianyang
         * @date 2025-06-16 09:37:02
         *
         */
        public class Result {
            /**
             * 是否签名
             */
            private Boolean status = false;

            /**
             * 签名方式(默认为MD5，可选MD5、AES、RSA、MD5+RSA、AES+RSA)
             */
            private String type = "MD5";

            /**
             * 秘钥(签名方式为MD5时必须设置)
             */
            private String secret;

            /**
             * 密码(签名方式为AES时必须设置)
             */
            private String password;

            /**
             * 私钥(签名方式为RSA、MD5+RSA、AES+RSA时必须设置)
             */
            private String priKey;

            public Boolean getStatus() {
                return status;
            }

            public void setStatus(Boolean status) {
                this.status = status;
            }

            public String getType() {
                return type;
            }

            public void setType(String type) {
                this.type = type;
            }

            public String getSecret() {
                return secret;
            }

            public void setSecret(String secret) {
                this.secret = secret;
            }

            public String getPassword() {
                return password;
            }

            public void setPassword(String password) {
                this.password = password;
            }

            public String getPriKey() {
                return priKey;
            }

            public void setPriKey(String priKey) {
                this.priKey = priKey;
            }

        }

        public Param getParam() {
            return param;
        }

        public void setParam(Param param) {
            this.param = param;
        }

        public Result getResult() {
            return result;
        }

        public void setResult(Result result) {
            this.result = result;
        }
    }

    public Integer getDuplicateOnclickTime() {
        return duplicateOnclickTime;
    }

    public void setDuplicateOnclickTime(Integer duplicateOnclickTime) {
        this.duplicateOnclickTime = duplicateOnclickTime;
    }

    public Integer getSessionExpire() {
        return sessionExpire;
    }

    public void setSessionExpire(Integer sessionExpire) {
        this.sessionExpire = sessionExpire;
    }

    public Integer getSecretMangerExpire() {
        return secretMangerExpire;
    }

    public void setSecretMangerExpire(Integer secretMangerExpire) {
        this.secretMangerExpire = secretMangerExpire;
    }

    public Log getLog() {
        return log;
    }

    public void setLog(Log log) {
        this.log = log;
    }

    public Encrypt getEncrypt() {
        return encrypt;
    }

    public void setEncrypt(Encrypt encrypt) {
        this.encrypt = encrypt;
    }

    public Sign getSign() {
        return sign;
    }

    public void setSign(Sign sign) {
        this.sign = sign;
    }
}
